<?php


namespace app\common\model\plan;

use app\admin\model\AuthDepartment;
use think\Model;

/**
 * 地区数据模型
 */



echo "请使用 app\admin\model\finance\extract\week;";
/*
class Plan extends Model
{
    protected $name = 'plan';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    // 追加属性
    protected $append = [
        'department_text',
        'status_text',
        'status_tu_text',
        'status_url_text',
        'username_text',
    ];
    public function getStatusUrlList()
    {
        return [-1=>'/index/plan/edit/ids/',0=>'/index/plan/edit/ids/',1=>'/index/plan/details/ids/',2=>'/index/plan/view/ids/',3=>'/index/plan/view/ids/'];
    } 
 	public function getStatusUrlTextAttr($value, $data)
    {
        $value = $value ? $value : $data['status'];
        $list = $this->getStatusUrlList();
        return isset($list[$value]) ? $list[$value] : '';
    }
    public function getStatusList()
    {
        return [-1=>'已驳回',0=>'草稿',1=>'审批中',2=>'已通过',3=>'已完成'];
    } 
    public function getStatustubiaoList()
    {
        return [-1=>'bohui',0=>'caogao',1=>'submit',2=>'pass',3=>'finish'];
    }
    public function getStatusTextAttr($value, $data)
    {
        $value = $value ? $value : $data['status'];
        $list = $this->getStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }  
    public function getStatusTuTextAttr($value, $data)
    {
        $value = $value ? $value : $data['status'];
        $list = $this->getStatustubiaoList();
        return isset($list[$value]) ? $list[$value] : '';
    }

    public function getDepidList()
    {
        return AuthDepartment::column('id,name');
    }

    public function getDepartmentTextAttr($value, $data)
    {
        $value = $value ? $value : $data['department'];
        $list = $this->getDepidList();
        return isset($list[$value]) ? $list[$value] : '';
    }    
     public function getUsernameTextAttr($value, $data){   
        $value = $value ? $value : $data['z_publish'];
        return TableField('Admin','username',$value,'userid');
    }


    public function log()
    {
        return $this->belongsTo('app\common\model\plan\Planlog', 'id', 'order_id', [], 'LEFT')->setEagerlyType(0);
    }

}*/
